Method and apparatus for masking a microprocessor execution signature

ABSTRACT

An apparatus and method are provided that disassociates the power consumed by a processing system from the instructions that it executes. The apparatus includes a power predictor that predicts the power that will be consumed by the processing system during execution of particular instructions, and a subsystem inhibition control, that selectively turns on/off available subsystems within the processing system based on the power that is predicted to be consumed. By predicting the power that will be consumed during execution, and by selectively turning on/off particular subsystems, the total power consumed by the processing system can be made invariant, or random. In either case, a counterweight current can be added to the processing system, depending on which of the subsystems are available to be turned on/off, and which are turned on/off, to further disassociate the total power consumed by the processing system from the instructions it is executing.

CROSS REFERENCE TO RELATED APPLICATION(S)

This application is a continuation of U.S. patent application Ser. No.09/894,812, filed Jun. 28, 2001 now U.S. Pat. No. 6,976,178, entitled “AMETHOD AND APPARATUS FOR DISASSOCIATING POWER CONSUMED WITHIN APROCESSING SYSTEM WITH INSTRUCTIONS IT IS EXECUTING”, which is acontinuation-in-part of U.S. patent application Ser. No. 09/665,099filed Sep. 20, 2000, now U.S. Pat. No. 6,625,737, entitled “SYSTEM FORPREDICTION AND CONTROL OF POWER CONSUMPTION IN DIGITAL SYSTEMS”, bothcommonly assigned to MIPS Technologies, Inc.

BACKGROUND OF THE INVENTION

1. Field of the Invention

This invention relates in general to the field of instruction processingin computer systems, and more particularly to an apparatus and method ina CPU for predicting power consumption for executing instructions andcounterbalancing or randomizing total power consumption for securitypurposes by turning on or shutting down selected subsystems.

2. Description of the Related Art

Early computers processed instructions, one at a time, with theinstructions appearing on a data/address bus. The data/address bus waselectrically visible to a test engineer such that probes could bedirectly attached to the bus, and the bus could be monitored todetermine what instructions were executing. In fact, in embedded systemdesign, it was common for a developer to utilize a test device, such asa state analyzer, to help test and debug his program.

For example, a developer would connect a state analyzer to thedata/address bus of his computer, load his program into the memory ofthe computer, and then reset the computer so that it would beginprocessing his instructions. The state analyzer would record theinstructions being executed on a clock-by-clock basis. The developercould examine the instructions recorded by the state analyzer, and coulddetermine whether his program was executing as planned. In a similarmanner, someone wanting to discover what program was operating on acomputer could connect a state analyzer to the data/address bus, andcould capture the program as it executed (i.e. reverse engineer thecode).

With the advent of the microprocessor, testing of program code, andreverse engineering of program code, became more difficult. Earlymicroprocessors utilized address and data buses to obtain theirinstructions and data from external memory such as ROM's and RAM's.Thus, a state analyzer could be coupled to the address and data buses ofa microprocessor to capture the values appearing on the buses on aclock-by-clock basis. Software programs, called disassemblers, were thenused to interpret the values appearing on the address and data buses,and convert them into the actual instructions that were being executedby the microprocessor. Thus, state analyzers, along with disassemblers,were used both by software developers for debugging, and by thoseinterested in discovering what someone else had programmed.

As the complexity of microprocessors increased, so did the difficulty oftesting (or reverse engineering) the instructions they were executing.For example, modern processors, although they have external data andaddress buses, cannot successfully be probed to determine whatinstructions are executing. This is because the values appearing on theaddress and data buses seldom relate to what the processor is doing atany one time.

More specifically, within a modern microprocessor are large areas ofmemory (or cache) for both data and instructions. When a processor needsdata or instructions that are not already resident within the processor,the processor will request the data/instructions from external memory.It is common, however, for blocks of data/instructions, in addition tothose particularly requested, to be transferred back to the processor.So, examination of the external data/address buses during the transferdoes not provide any direct correlation to the instructions that areexecuting. In addition, as is most often the case, the data andinstructions that are executing are already resident within internalcache. So, as they execute, there is no activity on the externaladdress/data buses that provide any indication as to what is beingexecuted.

Furthermore, most modern processors are capable of executing multipleinstructions at the same time, using a technology referred to as“pipelining”. Although pipelining is beyond the scope of the presentdiscussion, it suffices to say that pipelining in a microprocessor issimilar to an assembly line, where an instruction proceeds thru severalstages within a processor, each stage performing a certain operation.The instruction is preceded and followed by other instructions, inpreceding and following stages in the pipeline. Thus, at any one time, apipelined microprocessor is executing as many different instructions asthere are stages in the pipeline (e.g., a 5 stage pipeline may beexecuting 5 different instructions).

So, since there is no longer a direct correlation between what appearson the data/address buses of a processor, and the instructions it isexecuting, and because multiple instructions are typically executingsimultaneously, other methodologies have been developed for bothsoftware test, and reverse engineering. For software test, a commonapproach is the use of a simulator. The simulator utilizes a softwaremodel of the internal architecture of a processor (such as a VHDL model)to execute a particular program. A trace output from the simulatorprovides an indication to a developer of how his program should functionwithin a fabricated processor. The simulator is a great tool for thedeveloper, because s/he has access to the internal model of theprocessor.

The reverse engineer, however, has no access to the internal model of aprocessor that s/he is trying to decode. Such an internal model ishighly proprietary, and closely guarded by the developer. But thereverse engineer has not been thwarted. Rather, a sophisticated science,referred to as “differential power analysis” (DPA), has been developedto speculate or determine the instruction flow within a processor.

In general, certain estimates can be made about the size and thus thepower requirements of particular functional blocks (cache, ALU,Register, etc.) of a modern processor. Using these estimates, the totalpower consumed by a microprocessor can be monitored on a clock-by-clockbasis, while the microprocessor is executing instructions. Analysis ofthe power consumed by the microprocessor, in conjunction with speculatedpower requirements associated with each of the instructions in theprocessor's instruction set, can often allow a reverse engineer toaccurately speculate or determine the instructions being executed by aprocessor.

In many cases, such reverse engineering can have devastatingconsequences. For example, one modern application of a microprocessor iswithin a smart card. The smart card is much like a credit card. However,it contains a microprocessor that stores confidential information suchas a person's bank account number, balance, medical history, socialsecurity number, etc. Thus, the developer of a smart card is veryinterested in preventing the information within the processor from beingdiscovered. Differential power analysis applied to reverse engineer theprocessor can allow such confidential to be discovered, and utilized, tothe detriment of the cardholder.

In view of the above, what is needed is an apparatus that may be usedwithin a microprocessor, to prevent the reverse engineering of theprogram that is executing on the processor.

More specifically, what is needed is a power management apparatus thatcan disassociate the power that is consumed by a microprocessor, duringinstruction execution, from the actual power requirements of thoseinstructions. Such an apparatus, in disassociating the power consumed bythe microprocessor, from the instructions it is executing, would thwarta reverse engineer's attempt to discover confidential information usingdifferential power analysis.

Moreover, what is needed is a power management apparatus that turns onor shuts down certain subsystems within the microprocessor, orsubsystems that are external to but associated with the microprocessor(i.e., such as a system on a chip), for the purpose of disassociatingthe instantaneous power drain of the microprocessor from theinstructions it is executing.

SUMMARY

For the foregoing reasons, there is a need for an apparatus and methodthat disassociates the power consumption of a microprocessor basedsystem from the instructions that it is executing.

To address the above-detailed deficiencies, it is an object of thepresent invention to provide a security system for a microprocessorhaving multiple subsystems to insure that the power consumption of themicroprocessor is not indicative of the instructions that it isexecuting. The security system includes a power correlator and subsysteminhibition control. The power correlator estimates the power that themicroprocessor will consume during execution of instructions. Thesubsystem inhibition control, utilizes the estimated power, andselectively turns on/off ones of the multiple subsystems within themicroprocessor during execution of the instructions. The ones of themultiple subsystems that are turned on/off are selected so as todisassociate the total power consumed by the microprocessor from theinstructions it is executing.

In yet another aspect, the present invention provides an apparatuswithin a processing system having multiple subsystems for randomizingthe total power consumed within the processing system. The apparatusincludes a random value generator, and subsystem inhibition control. Therandom value generator generates a random value as instructions areexecuted by the processing system. The subsystem inhibition controlturns on/off selected ones of the multiple subsystems in response to thegenerated random value. By turning on/off selected ones of thesubsystems, the subsystem inhibition control disassociates instructionsthat are executed from power consumed by the processing system duringtheir execution.

In a further aspect, the present invention provides a computer programproduct for use with a computing system. The computer program productincludes a computer usable medium, having computer readable program codeembodied in said medium, for causing a processing system having multiplesubsystems to be described. The computer readable program code includes:first program code for providing a power prediction system for providinga predictor of estimated power that will be consumed during execution ofinstructions by the processing system; and second program code forproviding a subsystem inhibition control, coupled to said powerprediction system, for receiving said predictor, and for turning on/offselected ones of the subsystems based on the value of said predictor.

Yet a further aspect of the invention provides a method fordisassociating the power that is consumed by a microprocessor havingmultiple subsystems, from the instructions that it is executing. Themethod includes: estimating the power that will be consumed by eachinstruction in the microprocessor; and selectively turning on/off onesof the multiple subsystems such that the total power consumed by themicroprocessor is unrelated to the instructions that are executing.

In a further aspect, the present invention provides a computer datasignal embodied in a transmission medium including computer-readablefirst program code for providing a power correlator that estimates thepower that will be consumed as an instruction executes on amicroprocessor having multiple subsystems; and computer-readable secondprogram code for providing subsystem inhibition control, for utilizingthe estimated power, and for selectively turning on/off ones of themultiple subsystems within the microprocessor during execution of theinstructions.

BRIEF DESCRIPTION OF THE DRAWINGS

These and other objects, features, and advantages of the presentinvention will become better understood with regard to the followingdescription, and accompanying drawings where:

FIG. 1 is a prior art diagram illustrating the use of differential poweranalysis to determine instruction flow in a microprocessor.

FIG. 2 is a prior art block diagram illustrating power variation perclock cycle of a sequence of executing instructions in a pipelinemicroprocessor.

FIG. 3 is a block diagram of a predicted power profile table accordingto the present invention that predicts power consumption, per pipelinestage.

FIG. 4 is a block diagram of the predictive power correlation accordingto the present invention, within a pipeline microprocessor.

FIG. 5 is a diagram illustrating the power consumption of a pipelinemicroprocessor incorporating the power prediction and counterweightaccording to the present invention.

FIG. 6 is a block diagram illustrating per stage power prediction logicwithin a pipeline processor according to the present invention.

FIG. 7 is a block diagram of a random power counterweight circuit withina pipeline microprocessor according to the present invention.

FIG. 8 is a graph illustrating the random power counterweight circuit ofFIG. 7.

FIG. 9 is a block diagram of a microprocessor incorporating subsysteminhibition control according to the present invention.

FIG. 10 is a graph illustrating the effect of the subsystem inhibitioncontrol on the instantaneous power drain of a microprocessor to maintaina constant power drain according to the present invention.

FIG. 11 is a graph illustrating the effect of the subsystem inhibitioncontrol on the instantaneous power drain of a microprocessor to providea random power drain according to the present invention.

DETAILED DESCRIPTION

Referring to FIG. 1, a block diagram of a microprocessor based system100 is shown to illustrate a prior art method of determining whatinstructions are executing on a microprocessor. The method utilizes atechnology referred to as differential power analysis. Morespecifically, a microprocessor 102 is shown attached to a differentialpower analyzer 104 via current probes 106. In most instances, thedifferential power analyzer 104 is a current monitor that is capable ofmeasuring current drain on selected pins of the microprocessor 102, on acontinuous basis. Since the voltage is constant, power consumed by themicroprocessor 102 may be determined by measuring the current drawn oneach of its power supply pins. A graph 108 is shown illustrating thecumulative current (measured along the y-axis) drawn by themicroprocessor 102 during consecutive clock cycles (measured along thex-axis). Also shown are two scientists 110 examining the chart 108 totry to understand what the microprocessor is doing during each clockcycle.

For example, it is possible to characterize functional blocks 103 withina microprocessor 102, such as floating point units, integer ArithmeticLogic Units (ALU's), cache memory systems, etc., in terms of how muchpower is required for the units to perform a task during a clock cycle.Once such a characterization is done (or estimated), measurement ofcurrent consumed by the microprocessor 102 can allow fairly accuratespeculation, if not determination, of exactly which instructions areexecuting on the microprocessor 102, even though the scientists 110 donot have access to programmed instructions, as written, or to theinternal buses of the microprocessor 102. And, by determining what theinstructions are that are executing on the microprocessor 102, securityfeatures of the microprocessor based system 100, may be broken.

Referring now to FIG. 2, a prior art block diagram 200 is shown toparticularly illustrate the effect of different instructions, orinstruction types, on the power consumption of a pipelinedmicroprocessor. More specifically, a 5-stage microprocessor 200 isshown. The stages include: Fetch 202, Register 204, ALU 206, Memory 208and Write 210. The Fetch stage 202 utilizes a program counter (notshown) to fetch instructions to be executed by the processor 200. Oncefetched, the instructions are provided to the Register stage 204. TheRegister stage 204 decodes the instructions, and if necessary, retrievesthe contents of specified operands and provides them to the ALU stage206. The ALU stage 206 either performs arithmetic on the operands, orcalculates addresses, for load/store instructions. Instruction flow thenproceeds to the Memory stage 208. The memory stage 208 is typicallyassociated with cache access for load/store operations. Instruction flowthen proceeds to the Write stage 210 where the result of ALU operations,or data retrieved from the cache, are written back to the register fileor memory (not shown).

For exemplary purposes, a table 220 is provided to illustrate theprogression of eight instructions (I₁-I₈) through the pipeline stages204-210 of the processor 200. One skilled in the art will appreciatethat the current values associated with each of the instructions isillustrative only, and no meaning should be attached to the specificvalues shown.

During a first clock cycle, instruction I₁ is in the W stage 210,instruction I₂ is in the M stage 208, instruction I₃ is in the A stage206, and instruction I₄ is in the R stage 204. As shown, each of theinstructions I₁ thru I₄ consumes different amounts of power (5-30)depending on what function they are performing, and depending on whichpipeline stage they are in. In this illustration, their combined currentconsumption is 65.

During a second clock cycle, instruction I₁ falls out of the pipeline,instructions I₂-I₄ proceed to the next pipeline stage, and instructionI₅ enters the R stage 204. At this point, two things should beunderstood. First, instructions typically proceed sequentially from theR stage 204, thru to the W stage 210. Second, the amount of currentconsumed by a particular instruction is not constant through each of thestages. Rather, the current consumed by a particular instruction willoften vary from stage to stage, with the amount in each stage determinedby the type of instruction executing. In the second clock cycle, thecombined current consumption is shown to be 70.

During a third clock cycle, instruction I₂ falls out of the pipeline,instructions I₃-I₅ proceed to the next pipeline stage, and instructionI₆ enters the R stage 204. In the third clock cycle, the combinedcurrent consumption is shown to be 45.

During a fourth clock cycle, instruction I₃ falls out of the pipeline,instructions I₄-I₆ proceed to the next pipeline stage, and instructionI₇ enters the R stage 204. In the fourth clock cycle, the combinedcurrent consumption is shown to be 60.

During a fifth clock cycle, instruction I₄ falls out of the pipeline,instructions I₅-I₇ proceed to the next pipeline stage, and instructionI₈ enters the R stage 204. In the fifth clock cycle, the combinedcurrent consumption is shown to be 80.

The above is particularly illustrated by reference to chart 230 thatgraphically depicts the total current consumption of the processor 200during clock cycles 1-5. It is information such as that shown within thechart 230 that is often used to break the security of a microprocessor200, by determining what instructions are executing on it, on aclock-by-clock basis.

Referring now to FIG. 3, a diagram 300 is shown of a power profile table308 within a decoder 302 of a modern microprocessor. More specifically,the decoder 302 includes an instruction register 304 for receiving andtemporarily storing instructions from a fetcher. The instructionregister 304 is attached to an instruction decoder 306. The decoder 306decodes the instructions in the register 304, and provides them to aninstruction buffer 310.

In addition, as the instruction decoder 306 decodes instructions, itprovides a signal to the power profile table 308 indicating theinstruction that is being decoded. That is, it indicates either the typeof instruction (Load, ALU, JMP, etc.), or alternatively, the actualinstruction within the instruction set of the microprocessor, which isbeing decoded. In one embodiment, the signal acts as an index into thepower profile table 308 to select one of n different power profileentries in the table.

Each of the entries in the power profile table 308 contains an estimatedpower value, corresponding to a particular pipeline stage in themicroprocessor. For example, the power profile entry associated withinstruction I₄ indicates that this instruction has a power value of 10within the F stage, 20 within the R stage, 10 within the A stage, 20within the M stage, and 10 within the W stage. As an entry in the powerprofile table 308 is indexed by the instruction decoder 306, theestimated power values are provided to a power profile register 312. Inone embodiment, the power profile register 312 contains temporarystorage for each of the power profile values for a particularinstruction, along with an instruction indicator to designate which ofthe instructions the power profile entry 308 is associated with. Oneskilled in the art will appreciate that the values contained in a powerprofile entry may be determined heuristically by the manufacturer of amicroprocessor prior to final fabrication. In addition, it should beappreciated that the power profile values will vary in differentprocessor designs, and with different technologies used to manufactureprocessors.

Referring now to FIG. 4, a block diagram of a microprocessor basedsystem 400 is shown illustrating a pipeline microprocessor, similar tothat described above with reference to FIG. 2, including however, thenovel power counterweight system of the present invention. Themicroprocessor based system 400 includes a microprocessor having fivepipeline stages: Fetch 402, Register 404, ALU 406, Memory 408, and Write410. In one embodiment, the power profile table 308 as shown in FIG. 3is contained within the Register stage 404. As an instruction is decodedwithin the Register stage 404, it is provided to an instruction register412. In addition, the decoder indexes into the power profile table 308,causing a power profile entry corresponding to the instruction to bestored into a power profile buffer 414. Then, as the instructionproceeds to each stage in the pipeline, the power profile entryassociated with the instruction also proceeds down the pipeline, beingstored in power profile buffers 414 located in each stage of thepipeline.

Coupled to each of the power profile buffers 414 are power predictors416. The power predictors 416 extract the particular power profile valuewithin the power profile buffer 414 that is appropriate for its pipelinestage. For example, the predictor 416 in the R stage will extract the Rpower profile value. The predictor 416 in the A stage will extract the Apower profile value, etc.

Thus, for the microprocessor based system 400, at any one time, fourdistinct power profile values will be extracted by the power predictors416, corresponding to four distinct instructions executing in the R, A,M and W stages of the pipeline. All of these power profile values areprovided to a power correlator 418 for arithmetic combining. In oneembodiment, the arithmetic combining is a simple summation of thevalues. In an alternate embodiment, the arithmetic combining allowspredefined weighting to be applied to particular stages and/or allowsminimum and maximum thresholds for each of the stages to be met, orsubstituted, for the values provided by the predictors 416. After thepower correlator 418 performs the arithmetic combining, the combinedpower estimate is provided to a power counterweight 420.

In an alternate embodiment, rather than providing a power profile table308 within the instruction decoder 302, a portion of the power profiletable 308 may be placed within each power predictor 416 that isapplicable for the pipeline stage within which the power predictor 416resides. That is, power profiles for the R stage 404 may be placedwithin the power predictor 416 associated with the R stage, powerprofiles for the A stage 406 may be placed within the power predictor416 associated with the A stage, and so on. Then, as each instructionproceeds thru the pipeline, the power predictor 416 for each pipelinestage indexes into its power profile table 308 and extracts a powerprofile for the instruction executing in its stage.

The power counterweight 420 receives the combined power estimate fromthe power correlator 418 and produces a counterweight current 422, thepurpose of which is to make the total power consumed by the processorbased system 400 to be invariant. That is, given a maximum powerconsumed by a processor based system 400, whenever the combined powerestimate is less than the maximum power, the power counterweight 420produces a counterweight current 422 that is equal to the maximum powerminus the combined power estimate. This can be written as:Counterweight Current=Max Power−Estimated Power

The maximum power threshold is provided via a maximum power thresholdregister 460 to the power counterweight 420. The contents of the powerthreshold register 460 may either be set from a pre-coded default 462,or alternatively, may be established at run-time through softwareconfiguration 464.

The power counterweight 420 is also coupled to a subsystem A 490 via aninhibit/burn signal line 492. Thus, as determined by the powercounterweight 420, if additional power consumption may be met by turningon (burn) subsystem A 490 within the processor based system 400, thepower counterweight indicates such to subsystem A 490 via theinhibit/burn signal line 492. This can be either in place of acounterweight current 422, or in addition to a counterweight current422. In addition, the power counterweight 420 may also choose to shutdown the operation of subsystem A 490, if its functionality is notrequired during the next clock cycle, by providing an inhibit signal onthe inhibit burn signal line 492, thereby reducing the power consumptionof the processor based system 400. Such inhibition of subsystem A 490can be accomplished either in addition to generation of thecounterweight current 422, or as an alternative to the counterweightcurrent 422 for the purpose of masking the power consumption ofparticular instructions that are executing (i.e., systems can be turnedoff to reduce current consumption in an amount proportional to apredicted value for a current clock cycle or randomly). One skilled inthe art should appreciate that the discussion above related to subsystemA is exemplary only. In practice, the processor based system 400 willcontain many subsystems (e.g., media processing unit, FPU, I/O circuits,random number generators, DRAM, etc.) that may be turned on even whenthey are not needed, to increase the power consumption of the processorbased system 400, or turned off, to reduce the power consumption of theprocessor based system 400, as determined by the power counterweight420. In one embodiment, located within the power counterweight 420 is atable (not shown) containing the on/off power requirements for each ofthe subsystems within the processor based system 400. Inhibit/burnsignal lines 492 are connected to each of the subsystems so that theymay be turned on or off as determined by the power counterweight 420.This will be particularly described below with reference to FIGS. 9 and10.

To illustrate the effect the power predictor 418 and power counterweight420 have on the total power consumed within the processor based system400, attention is now directed at FIG. 5. FIG. 5 contains a table 520,similar to that shown in FIG. 2, along with a power graph 530illustrating power consumed by a processor that is executing theinstructions in table 520.

More specifically, during clock cycle 1, instructions I₁ thru I₄ arefound within pipeline stages W-R, respectively. Thus, instructions I₁thru I₄ have a combined power consumption of 65. This is shown ascurrent (I) line 534. The power predictor 416 of FIG. 4 provides thepower estimate values for each of these instructions to the powercorrelator 418, which in turn, provides an arithmetic sum of thesevalues to the power counterweight 420. The power counterweight 420 thenproduces a counterweight current 422 of 15 so that a maximum powerthreshold of 80 is consumed by the processor based system 400.

During clock cycle 2, the power predictors 416 provide the powerestimate values for instructions I₂ thru I₅ to the power correlator 418to produce a combined power value of 70. This value is provided to thepower counterweight 420. The power counterweight 420 therefore providesa counterweight current 422 with a value of 10 so that a maximum powerthreshold of 80 is consumed by the processor based system 400. Thus,during clock cycle 2, although the instructions that are executing aredifferent than those executing in clock cycle 1, the total powerconsumed by the processor based system 400 is the same.

During clock cycle 3, the combined power estimate for instructions I₃thru I₆ is 45. This value is provided to the power counterweight 420, toproduce a counterweight current 422 of 35. Thus, the maximum powerthreshold that is consumed by the processor during clock cycle 3 is 80.

During clock cycle 4, the combined power estimate for instructions I₄thru I₇ is 60. This value is provided to the power counterweight 420, toproduce a counterweight current 422 of 20. Thus, the maximum powerthreshold that is consumed by the processor during clock cycle 4 is 80.

During clock cycle 5, the combined power estimate for instructions I₅thru I₈ is 80. This value is provided to the power counterweight 420, toproduce a counterweight current 422 of 0. Thus, the maximum powerthreshold that is consumed by the processor during clock cycle 5 is 80.

So, in graph 530, although we have different instructions proceedingthru the five pipeline stages during clock cycles 1-5, with differentcombined power consumption values (shown by line 534), the total powerconsumed remains at 80 (shown by line 532). This is because the powercounterweight 420 produces a differential counterweight current 422,illustrated by shaded area 536.

Referring now to FIG. 6, a block diagram is provided of a microprocessor600, similar to that described above with reference to FIG. 4. However,in this embodiment, rather than providing a power correlator 418 toarithmetically combine power profile values for each of the pipelinestages, a power counterweight 618 is added to each of the stages (r, a,m, and w) to produce distinct counterweight currents for each stage.Thus, the power estimate value is provided from the power predictor 616in each stage directly to a stage specific power counterweight 618. Theresulting maximum power consumed by the processor is identical to thatshown in FIG. 5, but without having to arithmetically combine theindividual power estimate values.

Referring to FIG. 7, and alternative embodiment of the present inventionis shown within a microprocessor 700. One purpose of the inventiondescribed above has been to disassociate the power consumed by amicroprocessor from the instructions it is executing. The embodimentsshown in FIGS. 4 and 6 disassociate the power by adding a counterweightcurrent to obtain a maximum threshold value, thereby making the currentdrain invariant. In contrast, the embodiment of FIG. 7 disassociates thepower consumed by the microprocessor with instructions it is executingby adding a random counterweight current.

The processor 700 includes a fetch stage 702, a register stage 704, anALU stage 706, a memory stage 708, and a write stage 710. Coupled to thefetch stage 702 (or alternatively the register stage 704) is a totalpower predictor 716. The total power predictor 716 is used to predictthe total power that will be consumed during each clock cycle byinstructions in the pipeline stages 704-710, similar to the powerpredictor 416 of FIG. 4. Although the predictor 716 is not necessary tothe embodiment shown in FIG. 7, its prediction can be used to limit therandom counterweight current 744 as will be further described below.Coupled to the total power predictor 716 is a counterweight generator740 for producing a random counterweight 744. The counterweightgenerator 740 is also connected to a random number generator 742.

Operationally, for each clock cycle of the microprocessor 700, therandom number generator 742 provides a random value to the counterweightgenerator 740. The counterweight generator 740 then generates a randomcounterweight current 744 that is proportional to the random valueprovided by the random number generator 742. By adding the randomcounterweight current 744 to the power already consumed by the executinginstructions, the total power consumed by the microprocessor 700 will bedisassociated with the instructions it is executing, as willparticularly illustrated below with reference to FIG. 8. This has beenaccomplished without any estimation of the power that will be consumed,and without any coupling of the counterweight generator to theinstructions that are executing. However, without the use of the totalpower predictor 716, it is possible that the power consumed by themicroprocessor 700, during a particular clock cycle, may exceed anoverall maximum threshold. So, the total power predictor 716 provides anestimate of the total power that will be consumed by the microprocessor700 to the counterweight generator 740. Within the counterweightgenerator 740 is a limiter that throttles the random counterweightcurrent 744 to a predefined threshold. That is, whenever the randomcounterweight current 744, plus the total estimated power that ispredicted by the total power predictor 716, exceeds a predefinedthreshold, the amount of the random counterweight current 744 is limitedso that the total power consumed by the microprocessor 700 does notexceed the predefined threshold. One skilled in the art will appreciatethat the predefined threshold may be set similar to that described abovewith reference to FIG. 4, either at time of fabrication, or via softwareconfiguration. In addition, the random counterweight current 744 may beadded to or subtracted from, a baseline power drain, on top of which therandomness is provided.

Referring now to FIG. 8, a graph 800 is shown illustrating the powerconsumption of the microprocessor 700 utilizing the counterweightgenerator 740. For ease of illustration, the instructions executingduring clock cycles 1-5 are the same as those illustrated in table 520of FIG. 5.

During the first clock cycle, instructions I₁ thru I₄ have a powerconsumption of 65. In addition, the random number generator 742 providesa random value to the counterweight generator 740 to produce a randomcounterweight current 744 of 15. So, the total power consumed by themicroprocessor is 80.

During the second clock cycle, instructions I₂ thru I₅ have a powerconsumption of 70 (5 more than in clock cycle 1). In addition, therandom number generator 742 provides a random value to the counterweightgenerator 740 to produce a random counterweight current 744 of 5. So,the total power consumed by the microprocessor is 75. So, during clockcycle 2, even though the total power consumed by instructions I₂ thru I₅is greater than the instructions executing during clock cycle 1, thetotal power consumed by the microprocessor 700 is 5 less than duringclock cycle 1.

During the third clock cycle, instructions I₃ thru I₆ have a powerconsumption of 45. In addition, the random number generator 742 providesa random value to the counterweight generator 740 to produce a randomcounterweight current 744 of 40. So, the total power consumed by themicroprocessor is 85. So, during clock cycle 3, even though the totalpower consumed by instructions I₃ thru I₆ is less than the instructionsexecuting during clock cycles 1 or 2, the total power consumed by themicroprocessor 700 is greater than during those clock cycles.

During the fourth clock cycle, instructions I₄ thru I₇ have a powerconsumption of 60. In addition, the random number generator 742 providesa random value to the counterweight generator 740 to produce a randomcounterweight current 744 of 10. So, the total power consumed by themicroprocessor is 70.

During the fifth clock cycle, instructions I₅ thru I₈ have a powerconsumption of 80. In addition, the random number generator 742 providesa random value to the counterweight generator 740 to produce a randomcounterweight current 744 of 15. However, in this instance, thecounterweight current 744, plus the estimated power consumption of 80,exceeds a maximum power threshold of 85. So, the counterweight generatorwith limiter 740 limits the random counterweight current 744 to a valueof 5, resulting in a total power consumption of 85.

What has been illustrated with respect to FIGS. 3-6 are embodiments ofthe invention that disassociate power consumption of a processing systemwith the instructions it is executing by estimating the power that willbe consumed during each clock cycle, and by modulating the overall powerconsumption of a system by various means (adding counterweight currents,enabling/disabling subsystems, etc.) to mask the execution signature ofthe processing system, regardless of what instructions are in thepipeline. With respect to FIGS. 7-8, an embodiment of the invention isdescribed that disassociates the power consumption of a processingsystem with the instructions it is executing, by adding a randomizedcounterweight current to the total power consumed. Thus, whether thetotal power consumed is made invariant, or is randomized, there is nocorrelation between the total power consumed and the instructions thatare being executed, that may be used by scientist to speculate ordetermine the instruction flow of a processing system incorporating thepresent invention.

The above-described embodiments disassociate the instantaneous powerdrain of the processor, either by randomizing the clock-by-clock powerdrain, or by maintaining a constant power drain. In most instances, thisis performed by adding a counterweight current. It is also desirable, asmentioned above with reference to FIG. 4, to turn on or shut downvarious subsystems on a microprocessor based system, if possible. Byselectively inhibiting power drain from selected subsystems,instantaneous power drain can be disassociated with instructionexecution, while reducing the total power drain of the processor basedsystem. This methodology will now be further described with reference toFIGS. 9-10, to which attention is now directed.

Referring to FIG. 9, a microprocessor 900 is shown, similar to the onedescribed above with respect to FIG. 4. Like elements have likereferences with “9” replacing “4” in the hundreds digit. In addition,three subsystems 990, 991, and 993 identified as subsystems A, B, C areshown. As mentioned above with respect to FIG. 4, these subsystemsinclude FPU's, media processing unit units, or any other subsystemwithin a microprocessor than can be selectively turned on/off toincrease or reduce the power drain of the microprocessor 900. Thesubsystems 990, 991, 993 are coupled to the power prediction system 920via inhibit/burn signal lines 992. In FIG. 9, the inhibit/bum signallines 992 are shown as bi-directional because they are also intended toconvey “subsystem available” information from each of the subsystems991, 991, 991 to the power prediction system 920. That is, if themicroprocessor 900 determines that any of its subsystems will not beneeded for processing, it will provide an indication to the powerprediction system 920, on the signal lines 992, to indicate which, ifany, of the subsystems may be inhibited, or powered off. The powerprediction system can then choose to inhibit those available subsystems,as will now be further described.

Within the power prediction system 920 are subsystem power profiles 921and subsystem inhibition/selection control 923. In one embodiment, thesubsystem power profiles 921 provide an indication to the powerprediction system 920 of the amount of power that each subsystemconsumes when it is powered on. The power prediction system 920 utilizesthe information contained in the subsystem power profiles 921 to selectparticular ones of the subsystems 990, 991, 993 to be powered down. Thesubsystem inhibition/selection control 923 works in conjunction with thepower prediction system 920 to select particular ones of the subsystems990, 991, 993 to be shut down as will now be described with reference toFIG. 10.

FIG. 10 provides a graph 1000 that illustrates 5 clock cycles ofinstruction execution within the microprocessor 900. Two power lines1034, 1036 are shown. The first power line 1034 illustrates the powerdrain within the microprocessor 900 during 5 clock cycles, withoututilizing the power prediction system 920 of the present invention. Thesecond power line 1036 illustrates the use of the subsysteminhibition/selection control 923, along with the power prediction system920, to maintain a constant power drain for the microprocessor 900,thereby disassociating the instantaneous power drain from instructionexecution.

During a first clock cycle, the power prediction system receives a powerpredictor 919 from the power correlator 918 and determines that thecumulative power drain in all stages of the microprocessor 900 will beless than a predetermined threshold. Rather than adding a counterweightcurrent, the power prediction system 920 determines which of thesubsystems 990, 991, 993 are available to be shut down, via theinhibit/burn signal lines 992, and communicates how much “counterweight”current is needed to maintain a constant power drain. The subsysteminhibition/selection control 923 utilizes the subsystem power profiles921 to select an available subsystem to shut down. In this instance,subsystem A 990 provides the appropriate counterweight current, and isturned on, via inhibit/burn signal line 992.

During clock cycle 2, the power prediction system 920 determines thatthe predetermined power drain can be maintained by turning offsubsystems A 990 and C 993, and therefore utilizes the subsysteminhibition/selection control 923 to turn off these subsystems.

During clock cycle 3, the power prediction system determines that tomaintain a constant power drain, subsystems A 990, B 991, and C 993 mustall be turned on, and therefore turns them on via inhibit/burn signallines 992.

During clock cycle 4, the power prediction system determines that tomaintain a constant power drain, subsystems A 990, and C 993 must beturned off, and therefore turns them off via inhibit/burn signal lines992.

During clock cycle 5, the power prediction system determines that tomaintain a constant power drain, subsystem B 991 must be turned off, andtherefore turns it off via inhibit/burn signal lines 992.

At this point, one skilled in the art will appreciate that themicroprocessor 900 has maintained a constant power drain during clockcycles 1-5 while draining less power than the embodiment described abovewith respect to FIG. 5. This is because it was possible to inhibit, orturn off, particular subsystems to maintain a constant power drain,rather than adding a differential power, or counterweight current.

Referring now to FIG. 11, a graph 1100 is shown illustrating the use ofthe subsystem inhibition/selection control 923 of the present invention,in conjunction with the random counterweight circuitry described abovewith reference to FIGS. 7 and 8, to provide a randomized power drainshown by power line 1134, in response to an actual instruction powerdrain shown by power line 1132. That is, the random value generator 742of FIG. 7 provides a randomized desired power value, which in thisinstance may be positive or negative, to the subsysteminhibition/selection control 923. The inhibition/selection control 923then turns on or turns off, available subsystems 990, 991, 993 toachieve a total power consumption that is random with respect toinstruction execution.

While not specifically described above, one skilled in the art willappreciate that the ability to turn on or off particular subsystemswithin a microprocessor, to disassociate instantaneous power drain fromthe actual power required to execute instructions, may be used asdescribed in FIG. 9, or may be combined with the counterweight currentembodiment described above with respect to FIG. 4, and/or may becombined with the random counterweight current embodiment describedabove with respect to FIG. 7. That is, each embodiment has particularbenefits, and may be utilized singly, or in combination with the otherembodiments to obtain an optimum solution for a particularimplementation. If a microprocessor has numerous subsystems that may beturned on/off, and if it is desired to reduce total power consumption toan absolute minimum, then the embodiment described with reference toFIG. 9 may provide the optimum solution. However, if total powerconsumption is irrelevant, and disassociation of instruction executionwith power consumption is the primary concern, then the embodimentdescribed with reference to FIG. 9 may be incorporated along with thecounterweight currents of either FIG. 4 and/or FIG. 7.

Although the present invention and its objects, features, and advantageshave been described in detail, other embodiments are encompassed by theinvention as well. In addition to implementations of the invention usinghardware, the invention can be embodied in a computer usable (e.g.,readable) medium configured to store a computer readable program code.The program code causes the enablement of the functions or fabrication,or both, of the invention disclosed herein. For example, this can beaccomplished through the use of general programming languages (e.g., C,C++, etc.), hardware description languages (HDL) including Verilog HDL,VHDL, AHDL (Altera Hardware Description Language) and so on, or otherprogramming and/or circuit (i.e., schematic) capture tools available inthe art. The program code can be disposed in any known computer usablemedium including semiconductor memory, magnetic disk, optical disc(e.g., CD-ROM, DVD-ROM, etc.) and as a computer data signal embodied ina computer usable (e.g., readable) transmission medium (e.g., carrierwave or any other medium including digital, optical or analog-basedmedium). As such, the code can be transmitted over communicationnetworks including the Internet and intranets. It is understood that thefunctions accomplished by the invention as described above can berepresented in a core (e.g., a microprocessor core) that is embodied inprogramming code and may be transformed to hardware as part of theproduction of integrated circuits. Also, the invention may be embodiedas a combination of hardware and software.

In addition, the present invention has been particularly characterizedin terms of a CPU or microprocessor. In particular, the embodiments ofthe present invention described with reference to FIGS. 3-11 portray itsapplication within a 5-stage pipelined CPU based system 400. Thesespecific embodiments and characterizations are presented herein asrepresentative embodiments for the present invention. However, suchdescription should by no means restrict application of the concept to apipeline microprocessor, much less a 5-stage processor. Rather, theembodiments described that make the total power consumption of aprocessing system invariant, or random, may be applied to any processingsystem capable of executing instructions.

Furthermore, the discussion above has not attempted to describe theoperation of the invention within the nuances of modern processorinstruction flow. That is, one skilled in the art will appreciate thatinstruction flow within a pipeline microprocessor is oftennon-sequential, with flow being interrupted by branches, errorconditions, etc. In addition, it is common for instruction flow to stallor slip for a number of cycles, either when waiting on followingpipeline stages to complete an operation, or when retrieving/storingdata from/to memory. Such discussion has been removed so that the readerwill more readily understand the invention. However, while not shown, itshould be understood that the counterweight current of the presentinvention, particularly, the power counterweight block 420, shadows thepipeline of the processing system. That is, the counterweight bock 420is coupled to the interlock control of a processing system, and thepower predictor 416 is coupled not only to the decoder, but also to theinstruction pointer (and next instruction pointer) so that they mayproperly estimate and control the counterweight current in relation tothe actual instruction flow of a modern processing system, regardless ofslips or stalls in processing.

Those skilled in the art should appreciate that they can readily use thedisclosed conception and specific embodiments as a basis for designingor modifying other structures for carrying out the same purposes of thepresent invention, and that various changes, substitutions andalterations can be made herein without departing from the spirit andscope of the invention as defined by the appended claims.

1. A security system for a microprocessor based system having multiplesubsystems for ensuring that power consumption of the microprocessorbased system is not indicative of a plurality of instructions that themicroprocessor is executing, the security system comprising: a powercorrelator for estimating power that each instruction of the pluralityof instructions will consume during its execution; and a subsysteminhibition control, coupled to said power correlator, for utilizing saidestimated power, and for selectively turning on/off ones of the multiplesubsystems within the microprocessor based system during execution ofthe instructions, wherein the ones of the multiple subsystems that areturned on/off are selected so as to disassociate total power consumed bythe microprocessor based system from the instructions it is executing.2. A security system for ensuring that power consumption of amicroprocessor based system having multiple subsystems is not indicativeof instructions that the microprocessor is executing, the securitysystem comprising: a power correlator for estimating power that themicroprocessor based system will consume during execution ofinstructions; and a subsystem inhibition control, coupled to said powercorrelator, for utilizing said estimated power, and for selectivelyturning on/off ones of the multiple subsystems within the microprocessorbased system during execution of the instructions, wherein the ones ofthe multiple subsystems that are turned on/off are selected so as todisassociate total power consumed by the microprocessor based systemfrom the instructions it is executing, and wherein said subsysteminhibition control utilizes said estimated power to determine how muchpower to add to or subtract from said estimated power, to insure thatpower consumption of the microprocessor based system is not indicativeof the instructions it is executing.
 3. The security system of claim 2,wherein power is added to said estimated power by turning on said onesof the multiple subsystems.
 4. The security system of claim 2, whereinpower is subtracted from said estimated power by turning off said onesof the multiple subsystems.
 5. The security system of claim 1, whereinsaid power correlator estimates power each instruction will consume ineach of a plurality of stages within a pipeline of the microprocessorbased system.
 6. The security system of claim 1, wherein said powercorrelator comprises a power profile table having a plurality of powerprofile entries corresponding to a plurality of different instructions,said entries having a plurality of power estimates corresponding topower consumed in a plurality of different pipeline stages within themicroprocessor based system.
 7. The security system of claim 6, whereinsaid power correlator further comprises a power profile register,coupled to said power profile table, for temporarily storing one of saidpower profile entries corresponding to one of said plurality ofdifferent instructions.
 8. The security system of claim 7, wherein saidpower profile register provides said one of said power profile entriesto said power correlator.
 9. The security system of claim 1, whereinsaid subsystem inhibition control comprises subsystem power profile forindicating to said subsystem inhibition control how much power each ofthe multiple subsystems consume when turned on.
 10. An apparatus, withina processing device having multiple subsystems, for randomizing totalpower consumed within the processing device, comprising: a random valuegenerator for generating a random value as instructions are executed bythe processing device; and subsystem inhibition control, coupled to saidrandom value generator, for turning on/off selected ones of the multiplesubsystems, wherein said subsystem inhibition control disassociates saidinstructions that are executed from total power consumed by theprocessing device during their execution.
 11. The apparatus of claim 10,wherein said random value generator generates said random value betweenpredetermined minimum and predetermined maximum values.
 12. Theapparatus of claim 10, further comprising: a total power predictor,coupled to said subsystem inhibition control, for providing an estimatedtotal power value to said subsystem inhibition control.
 13. Theapparatus of claim 12, wherein said subsystem inhibition controlutilizes said estimated total power value so that the total powerconsumed by the processing device does not exceed a predeterminedthreshold.
 14. A computer program product for use with a computingdevice, the computer program product comprising: a computer readablestorage medium having computer readable program code embodied thereonfor causing a processing device having multiple subsystems to bedescribed, said computer readable program code comprising: firstcomputer readable program code for providing a power prediction systemfor providing a predictor of an estimated power that will be consumed bythe processing device during execution of each of a plurality ofinstructions by the processing device; and second computer readableprogram code for providing a subsystem inhibition control, coupled tosaid power prediction system, for receiving said predictor, and forturning on/off selected ones of the subsystems based on a value of saidpredictor to disassociate total power consumption of the processingdevice from the power consumption caused by execution of the pluralityof instructions.
 15. The computer program product of claim 14, furthercomprising third computer readable program code for providing a powerprofile table having a plurality of power consumption entries, saidentries corresponding to types of instructions that may be executed bythe processing device.
 16. The computer program product of claim 14,wherein said subsystem inhibition control comprises: selection control,for determining which of the subsystems are available to be turned off;and subsystem power profiles, coupled to said selection control, forspecifying an estimated power consumption for each of the subsystems.17. The computer program product of claim 16, wherein said selectioncontrol utilizes said estimated power consumption for each of thesubsystems to determine which, if any, of the subsystems to turn on/off.18. The computer program product of claim 14, wherein said subsysteminhibition control turns on/off selected ones of the subsystems tominimize the variation of total power consumption of the processingdevice, regardless of which instructions are executing on the processingdevice.
 19. The computer program product of claim 14, wherein saidsubsystem inhibition control turns on/off selected ones of thesubsystems to cause the total power consumption of the processing deviceto be random, regardless of which instructions are executing on theprocessing device.
 20. A method for disassociating power that isconsumed by a microprocessor having multiple subsystems from a pluralityof instructions that the microprocessor is executing, the methodcomprising: estimating power that will be consumed by each instructionexecuting in the microprocessor; and selectively turning on/off ones ofthe multiple subsystems in accordance with the estimated power such thatthe total power consumed by the microprocessor is disassociated from theinstructions that are executing.
 21. The method of claim 20, whereinsaid step of turning on/off ones of the multiple subsystems causes thetotal power consumed by the microprocessor to be invariant.
 22. Themethod of claim 20, wherein said step of turning on/off ones of themultiple subsystems causes the total power consumed by themicroprocessor to be random.
 23. A method for providing a securitysystem for a microprocessor based system having multiple subsystems, thesecurity system ensuring that power consumption of the microprocessorbased system is not indicative of a plurality of instructions that themicroprocessor is executing, the method comprising: providing a computerreadable storage medium having encoded thereon computer-readable programcode describing the security system, the computer-readable program codecomprising: first computer-readable program code for describing a powercorrelator, the correlator for estimating power that each instruction ofthe plurality of instructions the microprocessor based system willconsume during its execution; and second computer-readable program codefor describing a subsystem inhibition control, coupled to the powercorrelator, for utilizing the estimated power, and for selectivelyturning on/off ones of the multiple subsystems within the microprocessorbased system during execution of the instructions, wherein the ones ofthe multiple subsystems that are turned on/off are selected so as todisassociate the total power consumed by the microprocessor based systemfrom the instructions it is executing; and transmitting thecomputer-readable program code as a computer data signal on a network.24. The method of claim 23, wherein said power correlator comprises apower profile table having a plurality of power profile entriescorresponding to a plurality of different instructions, the entrieshaving a plurality of power estimates corresponding to power consumed ina plurality of different pipeline stages within the microprocessor basedsystem.
 25. The method of claim 24, wherein said power correlatorfurther comprises a power profile register, coupled to the power profiletable, for temporarily storing one of the power profile entriescorresponding to one of the plurality of different instructions.
 26. Amethod for providing an apparatus, within a processing device havingmultiple subsystems, for randomizing the total power consumed within theprocessing device, the method comprising: providing a computer readablestorage medium having encoded thereon computer-readable program codedescribing the apparatus, the computer-readable program code comprising:first computer-readable program code for describing a random valuegenerator for generating a random value as instructions are executed bythe processing device; and second computer-readable program code fordescribing a subsystem inhibition control, coupled to the random valuegenerator, for turning on/off selected ones of the multiple systems,wherein the subsystem inhibition control disassociates the instructionsthat are executed from total power consumed by the processing deviceduring their execution; and transmitting the computer-readable programcode as a computer data signal on a network.